package com.itheima.d6_singleInstance;

// 懒汉式单例 ==> 要用的使用再创建
public class B {
    private static B b;

    private B() {
    }

    public static B getInstance() {
        if (b == null) {
            b = new B();
        }
        return b;
    }
}
